﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Treatment.cs" company="ELEN 7045 GROUP II">
//   Contributed by E.Vosloo
// </copyright>
// <summary>
//   The Treatment class of the StudyDefinition entity module.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Domain.StudyDefinition.Entities
{
    #region

    using System;
    using System.Collections.ObjectModel;

    #endregion

    /// <summary>
    /// The Treatment class of the Study definition entity module.
    /// </summary>
    public class Treatment
    {
        #region Properties

        /// <summary>
        /// Gets or sets the description of the treatment.
        /// </summary>
        /// <value>
        /// The description of the treatment.
        /// </value>
        public string Description { get; set; }

        /// <summary>
        /// Gets or sets the id of the treatment.
        /// </summary>
        /// <value>
        /// The id of the treatment.
        /// </value>
        public int Id { get; set; }

        /// <summary>
        /// Gets or sets the name of the treatment.
        /// </summary>
        /// <value>
        /// The name of the treatment.
        /// </value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the tasks.
        /// </summary>
        /// <value>
        /// The tasks.
        /// </value>
        public Collection<PlannedTask> PlannedTasks { get; set; }

        /// <summary>
        /// Gets or sets the round interval of the subject group.
        /// </summary>
        /// <value>
        /// The round interval.
        /// </value>
        public TimeSpan RoundInterval { get; set; }

        /// <summary>
        /// Gets or sets the subject groups associated with the treatment.
        /// </summary>
        /// <value>
        /// The subject groups associated with the treatment.
        /// </value>
        public Collection<SubjectGroup> SubjectGroups { get; set; }

        #endregion

        #region Public Methods

        /// <summary>
        /// Adds the subject group.
        /// </summary>
        /// <param name="subjectGroup">
        /// The subject group.
        /// </param>
        public void AddSubjectGroup (SubjectGroup subjectGroup)
        {
            if(this.SubjectGroups.Contains(subjectGroup))
            {
                return;
            }

            this.SubjectGroups.Add(subjectGroup);
        }

        #endregion
    }
}
